<?php
/**
 * 系统设置控制器 
 * @date 2014/01/11  
 * @author 马燕龙
 */
class SettingAction extends CommonAction{

	public function setting(){
		
		$Setting = D('Setting');
		//处理修改
		if(!empty($_POST)){

			if($Setting->create()){
				$result = $Setting->save();
				if($result){
					$this->success('修改成功！');
				}else{
					$this->error('修改失败！');
				}
			}else{
				$this->error($this->getError());
			}
			exit;
		}

		//赋值相关数据到模板 显示页面
		$data = $Setting->find(1);
		$this->assign('status',$Setting->status);
		$this->assign('item',$data);
		$this->display();
	}
}